package com.eis.function.in;

import java.util.Date;
import java.util.TimerTask;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.eis.function.in.base.EisTimerTask;
import com.eis.function.in.base.Timer;

public class FunctionStatusUpdateTimer extends TimerTask implements Timer {
	private static final Logger logger = LoggerFactory.getLogger(FunctionStatusUpdateTimer.class);
	private EisTimerTask timerTask;
	
	@Override
	public void run() {
		Date now = new Date();
		logger.debug("status update timer runs at: " + now.toString());
		timerTask.startTask();
		logger.info("status update timer run finished, start time: " + now.toString() + " end time: " + (new Date()).toString());
	}

	@Override
	public void setTimerTask(EisTimerTask timerTask) {
		this.timerTask = timerTask;
	}
}
